// headers from this project
#include "factory_method.hpp"

// headers from standard libraries
#include <iostream>

void DesignPatterns::laptop::run()
{
	std::cout << "Laptop is hibernating." << std::endl;
}

void DesignPatterns::laptop::stop()
{
	std::cout << "Laptop isn't hibernating." << std::endl;
}

void DesignPatterns::desktop::run()
{
	std::cout << "desktop is turned on." << std::endl;
}

void DesignPatterns::desktop::stop()
{
	std::cout << "desktop isn't turned on." << std::endl;
}

DesignPatterns::computer*
DesignPatterns::computer_factory::new_computer(const std::string& d)
{
	if (d == "laptop") {
		return new laptop;
	}
	if (d == "desktop") {
		return new desktop;
	}
	return NULL;
}
